import 'package:flutter/material.dart';
import 'package:scratcher/widgets.dart';

class GuaCard extends StatefulWidget {
  const GuaCard({Key key}) : super(key: key);

  @override
  _GuaCardState createState() => _GuaCardState();
}

class _GuaCardState extends State<GuaCard> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("刮卡"),
      ),
      body: Scratcher(
        brushSize: 30,
        threshold: 50,
        color: Colors.grey,
        // image: Image.network("https://scpic.chinaz.net/files/pic/pic9/201912/zzpic22231.jpg",fit: BoxFit.cover,),
        onChange: (value) => print("Scratch progress: $value%"),
        onThreshold: () => print("Threshold reached, you won!"),
        child: Container(
          height: MediaQuery.of(context).size.height,
          width: MediaQuery.of(context).size.width,
          child: Image.network(
              "https://scpic.chinaz.net/files/pic/pic9/202001/zzpic22669.jpg",
            fit: BoxFit.cover,
          ),
        ),
      ),
    );
  }
}
